<?php
namespace AuctionCore\CarResource;

/**
 * 第三方查询记录model
 * Class DealerRepairLog
 * @package AuctionCore\CarResource
 */
class ThirdRepairLog {

	/**
	 * 构造
	 * @param  int $car_id  车辆id
	 * @return array
	 */
	public function __construct() {
	}

	/**
	 * 新增日志
	 */
	public function save_log($data){
		return M('third_repair_log')->add($data);
	}
	/**通过类型查询记录
	 * @param $map
	 * @return mixed
	 */
	public function get_log_by_type($map){
		return M('third_repair_log')->where($map)->find();
	}

	/**通过id修改
	 * @param $map
	 * @param $where
	 * @return bool
	 */
	public  function update_by_id($map,$where){
		return M('third_repair_log')->where($where)->save($map);
	}

	/**通过order_id获取vin码
	 * @param $where
	 * @return mixed
	 */
	public function get_vin_by_order_id($where){
		return M('third_repair_log')->where($where)->find();
	}
}
